package pers.cz.jefconfig;

import pers.cz.jefconfig.config.DbConfigItem;
import pers.cz.jefconfig.config.JefConfiguration;

import java.util.List;

/**
 * @program: JefConfig
 * @description: 测试类
 * @author: Cheng Zhi
 * @create: 2022-07-15 14:27
 **/
public class Main {

    public static void main(String[] args) {
        //String s = JefConfiguration.get(NettyItem.NETTY_SERVER_HOST);
        //int anInt = JefConfiguration.getInt(NettyItem.NETTY_SERVER_PORT, 8888);
        //System.out.println(s);
        //System.out.println(anInt); -Djef.properties=file:///D:\Java\JavaSource\JefConfig\src\test\java\testdDir\my.properties
        //System.setProperty("jef.properties", "file:///D:\\Java\\JavaSource\\JefConfig\\src\\test\\java\\testdDir\\my.properties");
        System.setProperty("jef.properties", "file:///D:\\Java\\JavaSource\\JefConfig\\src\\test\\java\\testdDir\\test.yaml");
        //Student student = new Student();
        //student.setName("123456789");
        //JefConfiguration.set(DbConfigItem.DB_URL, student.getName());
        //System.setProperty("jef.properties", "file:///D:\\Java\\JavaSource\\JefConfig\\src\\main\\resources\\jef.xml");
        //String s = JefConfiguration.get(TestItem.TEST_ITEM);
        /*List<Student> obj = JefConfiguration.getList(TestItem.JEF_JEFMAP, Student.class);

        for (Student s : obj) {
            System.out.println(s.getAge());
            System.out.println(s.getName());
        }*/
        Student obj1 = JefConfiguration.getObj(TestItem.JEF_JEFTEST, Student.class);
        System.out.println(obj1.getMan());
        System.out.println(obj1.getStudents().get(0).getSchool());
/*        String s = JefConfiguration.get(DbConfigItem.COLLECT_THREAD_POOL_CORE);
        long aLong = JefConfiguration.getLong(DbConfigItem.COLLECT_THREAD_POOL_CORE, 100L);
        System.out.println(s);
        System.out.println(aLong);*/
        //System.out.println(JefConfiguration.get(DbConfigItem.DB_TYPE));
    }
}
